home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / u_man / cat1 / rld.z / rld
Encoding:
Text File  |  2002-10-03  |  29.1 KB  |  613 lines

  1. RLD(5)                                                Last changed: 3-17-00
  2.  
  3.  
  4. NAME
  5.      rld, rld.debug - Runtime linker and runtime linker with debugging
  6.      support
  7.  
  8. IMPLEMENTATION
  9.      IRIX systems
  10.  
  11. DESCRIPTION
  12.      rld, the runtime linker, exists in appropriate versions for
  13.      executables in each Application Binary Interface (ABI) available.  rld
  14.      is invoked when running a dynamic executable.  It maps in shared
  15.      objects used by the executable, resolves relocations as ld(1) does at
  16.      static link time, and allocates common, if required.
  17.  
  18.      When any dynamic executable is run, the system first runs an
  19.      interpreter, which is responsible for collecting the appropriate
  20.      objects, mapping them into memory, and resolving references during
  21.      runtime.  The name of the interpreter is included in the executable
  22.      file.  Dynamic execution is only supported with ELF-format
  23.      executables.  Such executables will have an INTERP section that
  24.      specifies the name of the interpreter.  The default name of the
  25.      interpreter is /usr/lib/libc.so.1.  Any binary that hopes to conform
  26.      to the old 32-bit MIPS SVR4 ABI should name /usr/lib/libc.so.1 as its
  27.      interpreter.
  28.  
  29.      For 64-bit ABI programs, the name of the interpreter is
  30.      /usr/lib64/libc.so.1.  The information on this man page applies to
  31.      64-bit programs if the directory /usr/lib64 is substituted for the
  32.      directory /usr/lib, and the directory /lib64 is substituted for /lib.
  33.  
  34.      For new 32-bit ABI programs, the name of the interpreter is
  35.      /usr/lib32/libc.so.1.  The information on this man page applies to new
  36.      32-bit ABI programs if the directory /usr/lib32 is substituted for the
  37.      directory  /usr/lib, and the directory /lib32 is substituted for /lib.
  38.  
  39.      The file /usr/lib/libc.so.1 is the standard C (or system) library in
  40.      the form of a shared object.  In addition, /usr/lib/libc.so.1 contains
  41.      code that loads the interpreter into its address space and sets it to
  42.      work.  The default interpreter is /lib/rld.
  43.  
  44.      One of the primary features of dynamic linking is that it gives users
  45.      the ability to change library implementations without recompiling the
  46.      executable.  Some mechanisms for doing this are listed below.
  47.      However, /usr/lib/libc.so.1 is not subject to any of the mechanisms
  48.      listed below, since it is known to the executable as the interpreter
  49.      as well as a needed shared object.  If you want to substitute
  50.      /usr/lib/libc.so.1, the best way is to make use of ld(1) command's -I
  51.      option.  The -I option can be passed from the compiler command line by
  52.      specifying the -Wl,-I,myinterpname option. However, any such shared
  53.      object specified must be able to act as interpreter (or invoke rld).
  54.  
  55.      rld constructs an explicit shared object list based on the information
  56.      listed in the .liblist section.  For old 32-bit ABI programs, if the
  57.      environment variable _RLD_LIST is set, it overrides the dynamic
  58.      executable's original list (after the original list is constructed).
  59.      The corresponding environment variable for 64-bit programs is
  60.      _RLD64_LIST, and for new 32-bit ABI programs it is _RLDN32_LIST.
  61.  
  62.      For new 32-bit ABI or 64-bit ABI programs, if _RLDN32_LIST or
  63.      _RLD64_LIST is not specified, rld honors _RLD_LIST, if specified.
  64.  
  65.      The user can include DEFAULT in _RLD_LIST (or _RLDN32_LIST or
  66.      _RLD64_LIST) to include the executable's original object list and
  67.      instruct rld to add new shared objects just before and/or after it.
  68.      The object list is specified as a colon-separated list of shared
  69.      objects.  The liblists of shared objects newly added from _RLD_LIST,
  70.      _RLDN32_LIST, or _RLD64_LIST are intentionally not processed:  it is
  71.      up to the user to make the list complete.
  72.  
  73. LIBRARY SEARCH PATHS
  74.      NOTE:  Because there are three distinct ABIs used by IRIX programs
  75.      with accompanying libraries, there are three distinct sets of rld
  76.      search paths.  In addition, there are usually 3 environment variables
  77.      for each purpose, one for each ABI.
  78.  
  79.      The default library search path for old 32-bit ABI programs is
  80.      /usr/lib:/usr/lib/internal:/lib:/lib/cmplrs/cc:/usr/lib/cmplrs/cc:/opt/lib,
  81.      which can be overridden by either the _RLD_ROOT or the LD_LIBRARY_PATH
  82.      environment variable.
  83.  
  84.      The default library search path for 64-bit ABI programs is
  85.      /usr/lib64:/usr/lib64/internal:/lib64:/opt/lib64, which can be
  86.      overridden by either the _RLD64_ROOT or the LD_LIBRARY64_PATH
  87.      environment variable.
  88.  
  89.      The default library search path for new 32-bit ABI programs is
  90.      /usr/lib32:/usr/lib32/internal:/lib32:/opt/lib32, which can be
  91.      overridden by either the _RLDN32_ROOT or the LD_LIBRARYN32_PATH
  92.      environment variable.
  93.  
  94.      For new 32-bit or 64-bit programs, if LD_LIBRARYN32_PATH or
  95.      LD_LIBRARY64_PATH is not specified, rld honors LD_LIBRARY_PATH, if
  96.      specified.  As a result, if LD_LIBRARY_PATH is set for an old 32-bit
  97.      program, it is recommended that you also set LD_LIBRARYN32_PATH and
  98.      LD_LIBRARY64_PATH to something ("", for example) to avoid having
  99.      LD_LIBRARY_PATH apply accidentally to new 32-bit and 64-bit
  100.      applications in that environment.
  101.  
  102.      The search path for shared objects is as follows:
  103.  
  104.      1. The path of the shared object, if specified in the liblist.  That
  105.         is, if the soname of the shared object has a path.  For more
  106.         information, see the ld(1) man page.
  107.  
  108.      2. DT_RPATH, if it is defined in the executable or any DSO that rld
  109.         has opened.
  110.  
  111.      3. Use LD_LIBRARY_PATH, if it is defined in the environment at the
  112.         time of execution.
  113.  
  114.      4. The default library search path.
  115.  
  116.      DT_RPATH is a colon-separated list of directories.  In the library
  117.      search algorithm outlined above, DT_RPATH refers to the net list of
  118.      paths at the time the search is done.  It is actually a tag in the
  119.      .dynamic section of a DSO or executable whose value is a string.
  120.      DT_RPATH is set in any given DSO or the executable by specifying the
  121.      -rpath option to the ld(1) command when the executable or DSO is
  122.      created.  Each DT_RPATH appends to the list of directories at the time
  123.      the executable or DSO is loaded.  There is no mechanism to remove
  124.      anything from the list of directories that rld builds for the
  125.      executable.
  126.  
  127.      LD_LIBRARY_PATH is a colon-separated list of directories.  If defined,
  128.      it specifies an extra set of directories in which rld is to look when
  129.      searching for shared objects.  LD_LIBRARY64_PATH and
  130.      LD_LIBRARYN32_PATH are treated in a similar fashion.
  131.  
  132.      _RLD_ROOT is a colon-separated list of directories.  If defined, the
  133.      list is appended to the front of DT_RPATH and the default path.
  134.      _RLD64_ROOT and _RLDN32_ROOT are treated in a similar fashion.
  135.  
  136.      To ensure compatibility, applications can choose to disallow library
  137.      replacement at exec(2) execution time or at runtime.  If the
  138.      dynamic-section flag, RHF_NO_LIBRARY_REPLACE, is set in an executable
  139.      or DSO and if the application's real userid is not zero (root), then
  140.      from the time the executable or DSO with RHF_NO_LIBRARY_REPLACE set is
  141.      mapped in to the end of the execution, LD_LIBRARY[n]_PATH and any
  142.      _RLD[n]_ROOT specifications are ignored.  RHF_NO_LIBRARY_REPLACE can
  143.      be set at link time by specifying the ld(1) command's
  144.      -no_library_replace option.
  145.  
  146.      Security dictates that rld should not allow library replacement or
  147.      other rld environment variables to be honored for setuid and setgid
  148.      programs unless the user is root.  If capabilities apply to an
  149.      executable, the capability change also creates security concerns.  In
  150.      these cases, library replacement and other rld environment variables
  151.      are not honored.  For more information on capabilities, see exec(2),
  152.      capability(4) and capabilities(4).
  153.  
  154.      Users can replace the default rld binary by setting the environment
  155.      variable _RLD_PATH to the full path of another runtime linker.
  156.      rld.debug is a version of rld that has debugging support.  By setting
  157.      the environment variable _RLD_PATH to /usr/lib/rld.debug, it replaces
  158.      the default rld as the runtime linker, and the debugging features it
  159.      supports are available.  For 64-bit programs, the environment variable
  160.      is _RLD64_PATH, and the debugging version of rld is
  161.      /usr/lib64/rld.debug.  For new 32-bit ABI programs, the environment
  162.      variable is _RLDN32_PATH, and the debugging version of rld is
  163.      /usr/lib32/rld.debug.
  164.  
  165.      rld also supports the environment variable LD_BIND_NOW, as documented
  166.      in the System V Application Binary Interface, Revised First Edition,
  167.      Prentice-Hall, ISBN 0-13-880410-9.  If LD_BIND_NOW is set to 1 or on,
  168.      the dynamic linker processes all relocation before transferring
  169.      control to the program; if LD_BIND_NOW is set to 0 or off, or if it
  170.      does not occur in the environment, the dynamic linker can perform
  171.      symbol resolution and relocation for functions lazily, meaning that it
  172.      avoids them until the functions are called.
  173.  
  174. RUNTIME LINKING INTERFACE
  175.      dlopen(3C), dlsym(3C), dlclose(3C), dlerror(3C) sgidlopen_version(3C),
  176.      and sgidladd(3C) are provided to supply users with the on-demand
  177.      loading of objects.  These routines are found in /usr/lib/libc.so.1.
  178.      No special options are needed at link time to access them.
  179.  
  180. RLD OPTIONS
  181.      The rld options are not needed to run properly coded and linked
  182.      executables, but they may be useful in special situations and for
  183.      debugging.  To specify rld options, set the _RLD_ARGS environment
  184.      variable to any combination of the following options:
  185.  
  186.      Option         Purpose
  187.  
  188.      -clearstack    For programs that assume local variables to be
  189.                     initialized to zero upon function entry, this option
  190.                     forces rld to zero any stack it uses before before
  191.                     calling the application's main program.  Properly
  192.                     written programs never assume that the stack is zeroed;
  193.                     therefore, properly written programs do not expect
  194.                     local variables to be automatically initialized except
  195.                     as provided for in the programming language definition.
  196.                     At startup, if a program or any of its DSOs' dynamic
  197.                     section flags do not have RHF_SGI_ONLY set, -clearstack
  198.                     is automatically turned on.
  199.  
  200.      -f             Fast mode.  Turns off reresolution of symbols on
  201.                     dlclose(3C).  This option is on by default.  It makes
  202.                     rld's behavior closer to that of other systems with
  203.                     dynamic loading and can substantially improve
  204.                     dlclose(3C) performance.  To turn off this mode and
  205.                     specify slower, full reresolution, specify the -s
  206.                     option.
  207.  
  208.                     When this option is specified, any symbol from the
  209.                     application that is bound to a symbol in the DSO closed
  210.                     by dlclose(3C) is a stale binding.  Any reference to a
  211.                     stale binding can crash the application.
  212.  
  213.      -idv           Ignores delay-loaded versions.  By default, rld honors
  214.                     version checking when loading a delay-loaded DSO.  For
  215.                     more information on version checking, see dso(5).
  216.  
  217.                     This behavior is nonstandard.  It matches the behavior
  218.                     of rld in previous releases.  Specifying this option
  219.                     restores previous behavior so that erroneous
  220.                     applications can be made to work.
  221.  
  222.      -ignore_all_versions
  223.                     Ignores versions on all objects.
  224.  
  225.      -ignore_version shared_object
  226.                     Ignores the version stamp checking on the object
  227.                     specified.  This option can be specified multiple times
  228.                     (in case multiple shared objects should have their
  229.                     versions ignored).
  230.  
  231.      -ignore_unresolved
  232.                     Does not issue messages or abort when rld cannot
  233.                     resolve unresolved data symbols.
  234.  
  235.      -log file      Prints all messages to file instead of to the device
  236.                     /dev/tty.  If /dev/tty is not available, the system log
  237.                     /var/adm/SYSLOG is used instead.
  238.  
  239.      -s             Slow mode.  Performs full reresolution of symbols on
  240.                     dlclose(3C).  Behavior obtained when this option is
  241.                     specified is the opposite of that obtained when -f is
  242.                     specified.  This makes dlclose(3C) slower and can
  243.                     result in a symbol binding effectively moving from a
  244.                     previous binding (eliminated by the dlclose(3C) itself)
  245.                     to a new one.
  246.  
  247.                     This behavior is nonstandard.  It matches the behavior
  248.                     of rld in previous releases.  Specifying this option
  249.                     restores previous behavior so that erroneous
  250.                     applications can be made to work.
  251.  
  252. RLD.DEBUG OPTIONS
  253.      For rld.debug to be invoked, certain environment variables must be
  254.      set, as follows:
  255.  
  256.      ABI                 Environment Variable and Setting
  257.  
  258.      Old 32-bit ABI      _RLD_PATH set to /usr/lib/rld.debug
  259.  
  260.      New 32-bit ABI      _RLDN32_PATH set to /usr/lib32/rld.debug
  261.  
  262.      64-bit ABI          _RLD64_PATH set to /usr/lib64/rld.debug.
  263.  
  264.      The options to rld described in the previous section are honored by
  265.      rld.debug.  In addition to those options, rld.debug supports
  266.      additional options; these, too, must be set in the _RLD_ARGS
  267.      environment variable.  The rld.debug options are as follows:
  268.  
  269.      Option              Purpose
  270.  
  271.      -debug symbol       Prints a verbose description of the actions taken
  272.                          resolving all symbols.  The option consists of the
  273.                          two literal words debug and symbol.  This produces
  274.                          a lot of output, so it is normally most useful to
  275.                          also use the -log option to direct the output to a
  276.                          file.  If you know the symbols you are interested
  277.                          in, use one or more instances of the -y option.
  278.  
  279.      -quickstart_info    Informs the user whether or not Quickstart has
  280.                          failed.
  281.  
  282.      -trace              Shows rld code flow and prints individual symbol
  283.                          actions.
  284.  
  285.      -v                  Prints rld actions at the level of the DSO not at
  286.                          the symbol level.  -v is less verbose than -trace.
  287.  
  288.      -yname              Prints a verbose description of the actions taken
  289.                          resolving name.  Note that there is no space
  290.                          permitted after the -y.  As many -y options as
  291.                          needed can be specified.   For example, to print
  292.                          descriptions of the actions on symbols pear and
  293.                          grape, specify the following:
  294.  
  295.                               -ypear -ygrape
  296.  
  297. RLD ENTRY POINTS
  298.      rld commences execution when exec(2) starts up a program using a DSO
  299.      and when lazy text resolution commences during program execution.
  300.  
  301.      When exiting, programs or objects call _rld_new_interface(_SHUT_DOWN)
  302.      to ensure that the program executes all of the code specified by the
  303.      -fini option to ld(1).  _exit(2) calls _rld_new_interface(_SHUT_DOWN).
  304.      Any call to _rld_new_interface(_SHUT_DOWN) runs the -fini code on all
  305.      objects, meaning that it cannot safely be done just anywhere.  Note
  306.      that _rld_new_interface(_SHUT_DOWN) is an internal routine and should
  307.      not be called by any application.
  308.  
  309. SYSTEM DEVELOPER'S INTERFACE
  310.      rld keeps a doubly linked list of structures.  crt1.o contains a
  311.      pointer, __rld_obj_head, to the head of the list of object structures.
  312.      This pointer's targets depend on the ABI, as follows:
  313.  
  314.      * For an old 32-bit executable, __rld_obj_head points to a linked list
  315.        of objList structures (/usr/include/obj_list.h).  Each of these
  316.        structures has a data element that is a pointer to a struct obj
  317.        (/usr/include/obj.h), even though the field is not declared as a
  318.        pointer.
  319.  
  320.      * For a new 32-bit executable, __rld_obj_head points to a linked list
  321.        of Elf32_Obj_Info structures:  /usr/include/objlist.h.
  322.  
  323.      * For a 64-bit executable, __rld_obj_head points to a linked list of
  324.        Elf64_Obj_Info structures:  /usr/include/objlist.h.
  325.  
  326.      The oi_magic element of each Elf32_Obj_Info or Elf64_Obj_Info is all-
  327.      bits-on (0xffffffff) to make it easier to determine which list type in
  328.      use is a 32-bit executable.
  329.  
  330. ENTRY POINTS
  331.      NOTE:  The interfaces described in this subsection are for system
  332.      development only.  They are not recommended nor supported for use in
  333.      end-user code.  They are described here for the benefit of system
  334.      developers.
  335.  
  336.      The declarations for the interfaces are in
  337.      /usr/include/rld_interface.h.
  338.  
  339.      The following is a list of currently defined operations:
  340.  
  341.      * (int)_rld_new_interface(_SHUT_DOWN).  This function calls the
  342.        routine specified by the -fini option to ld(1) on all open DSOs (and
  343.        the main program) in the reverse of the order that the -init
  344.        sections were run.
  345.  
  346.      * (char *)_rld_new_interface(_RLD_FIRST_PATHNAME).  This function
  347.        returns the string MAIN and resets an rld internal pointer to set up
  348.        for calls to (char *)_rld_new_interface(_RLD_NEXT_PATHNAME)
  349.  
  350.        This interface is not thread-safe.  Multiple threads doing this will
  351.        get erroneous results.  Any call to
  352.        _rld_new_interface(_RLD_MODIFY_LIST,p) after calling
  353.        _rld_new_interface(_RLD_FIRST_PATHNAME) and before calling
  354.        _rld_new_interface(_RLD_NEXT_PATHNAME) interferes with the
  355.        correctness of the rld_new_interface(_RLD_NEXT_PATHNAME) returns.
  356.  
  357.        Any operation (including delay-loading a DSO as a result of lazy
  358.        function evaluation) that causes the DSO list to be altered can
  359.        interfere with the correctness of
  360.        _rld_new_interface(_RLD_NEXT_PATHNAME) returns.
  361.  
  362.      * (char *)_rld_new_interface(_RLD_NEXT_PATHNAME).  This function
  363.        returns the next path name in rld's object list and increments its
  364.        internal pointer.  It returns NULL when rld reaches the end of the
  365.        list.  This interface is not thread-safe; multiple threads doing
  366.        this will get erroneous results.
  367.  
  368.        Calls to _rld_new_interface(_RLD_NEXT_PATHNAME) cannot be
  369.        interspersed with calls to _rld_new_interface(_RLD_MODIFY_LIST,....
  370.        Doing so will interfere with the correctness of the
  371.        _rld_new_interface(_RLD_NEXT_PATHNAME) returns.  Any operation,
  372.        including delay-loading a DSO as a result of lazy function
  373.        evaluation, that alters the DSO list may interfere with the
  374.        correctness of the _rld_new_interface(_RLD_NEXT_PATHNAME) returns.
  375.  
  376.      * (char *)_rld_new_interface(_RLD_MODIFY_LIST, Elf32_Word operation,
  377.        char *original_pathname, char *name).  This function allows users to
  378.        link and unlink objects.  When users insert or add an object, they
  379.        must specify the new object in name.  They may specify a full path
  380.        or take advantage of rld's searching mechanism.  Users are not
  381.        allowed to insert before MAIN.  If original_pathname is zero, rld
  382.        operates on the last element in the list.  The exact function
  383.        performed depends on the parameter operation, which can take the
  384.        following values:
  385.  
  386.         operation           Function Performed
  387.  
  388.         _RLD_OP_NONE        Does nothing.
  389.  
  390.         _RLD_OP_INSERT      Adds a new object specified by name before the
  391.                             object specified by original_pathname.  Objects
  392.                             cannot be added before main().
  393.  
  394.         _RLD_OP_ADD         Adds a new object specified by name after the
  395.                             object specified by original_pathname.  If
  396.                             original_pathname is omitted, the new object is
  397.                             appended to the object list.
  398.  
  399.         _RLD_OP_DELETE      Deletes original_pathname from the object list.
  400.  
  401.         _RLD_OP_REPLACE     Replaces original_pathname with the object
  402.                             specified by name in the object list.
  403.  
  404.      * (char *)_rld_new_interface(_RLD_ADDR_TO_NAME, Elf32_Addr address).
  405.        This function returns either the symbol name of address argument or
  406.        NULL (if no symbol corresponds to that address in the current
  407.        process).  In a 64-bit application, the second argument is of type
  408.        Elf64_Addr.
  409.  
  410.      * (Elf32_Addr)_rld_new_interface(_RLD_NAME_TO_ADDR, char *name).  This
  411.        function returns the actual address of name.  It returns NULL if rld
  412.        cannot find the passed argument.  In a 64-bit application, the value
  413.        returned is of type Elf64_addr.
  414.  
  415.      * (char *)_rld_new_interface(_RLD_VERSION_EXPECTED, char *soname).
  416.        This function returns the version string in MAIN's liblist entry for
  417.        soname.
  418.  
  419.      * (Elf32_Addr)_rld_new_interface(_RLD_SPROC_NOTIFY).  This function
  420.        signals to rld that sproc(2) has been called and that rld has to
  421.        handle multiple sproc threads.  The call is made by libc.so.
  422.  
  423.      * (Elf32_Addr)_rld_new_interface(_RLD_SHUTDOWN_THREAD).  This function
  424.        signals to rld that a thread is trying to exit.  Currently does
  425.        nothing when invoked.
  426.  
  427.      * (Elf32_Addr)_rld_new_interface(_RLD_SPROC_FINI).  This function
  428.        signals to rld that multiple sproc(2) threads support can be turned
  429.        off.  It is called on behalf of, and in, the child process after a
  430.        fork(2) by the fork code in libc.so.
  431.  
  432. EXAMPLES
  433.      The following csh(1) aliases control rld tracing.  There are three
  434.      sets of tracing aliases, one for each ABI.  See file(1) for
  435.      information on how to identify the ABI of a particular executable.
  436.  
  437.      The following alias pertains to old 32-bit executables:
  438.  
  439.           #  trace o32 rld issues
  440.              alias ra     \
  441.                 'setenv _RLD_PATH /usr/lib/rld.debug       ;'\
  442.                 'setenv _RLD_ARGS "\!*"                    ;'
  443.              alias nora   \
  444.                 'unsetenv _RLD_ARGS                        ;'\
  445.                 'setenv _RLD_PATH /lib/rld                 ;'
  446.  
  447.      The following alias pertains to new 32-bit executables:
  448.  
  449.           #  trace n32 rld issues
  450.              alias ra32   \
  451.                 'setenv _RLDN32_PATH /usr/lib32/rld.debug  ;'\
  452.                 'setenv _RLD_ARGS "\!*"                    ;'
  453.              alias nora32 \
  454.                 'unsetenv _RLD_ARGS                        ;'\
  455.                 'setenv _RLDN32_PATH /lib32/rld            ;'
  456.  
  457.      The following alias pertains to 64-bit executables:
  458.  
  459.           #  trace 64 rld issues
  460.              alias ra64   \
  461.                 'setenv _RLD64_PATH /usr/lib64/rld.debug   ;'\
  462.                 'setenv _RLD_ARGS "\!*"                    ;'
  463.              alias nora64 \
  464.                 'unsetenv _RLD_ARGS                        ;'\
  465.                 'setenv _RLD64_PATH /lib64/rld             ;'
  466.  
  467.      The following examples shows how the aliases are used.
  468.  
  469.      The first traces rld when it is running an old 32-bit binary (ls(1)):
  470.  
  471.        % ra -trace             <-- turns on tracing of o32 rld
  472.        % ls
  473.        27312:[rld] Entering RLD through MAIN
  474.        27312:ls: [rld] mapped ls at 0x400000
  475.        27312:ls: [rld] mapped /lib/libc.so.1 at 0xfa00000
  476.        27312:ls: [rld] found _end in ls for libc.so.1 at 0x10007000
  477.        27312:ls: [rld] number of objs in the objlist is 2
  478.        27312:ls: [rld] Exiting RLD through MAIN
  479.        RCS           libX11.so.2   libc.so       libl.a        setup
  480.        acrt1.o       libXaw.a      libc.so.1     libm.a        sgicc.cfg
  481.        crt1.o        libXext.a     libc.so.O     libmld.a      sgild.cfg
  482.  
  483.        % nora                  <-- turns off all o32 rld debugging options.
  484.  
  485.      The following traces rld when it is running a new 32-bit binary
  486.      (ci(1)):
  487.  
  488.        % ra32 -v               <-- turns on verbose mode in n32 rld
  489.        % ci -l c.c
  490.        14891:_RLD_ARGS = "-v"
  491.        14891:_RLD_ROOT = /
  492.        14891:LD_LIBRARYN32_PATH = none
  493.        14891:ci: mapped ci at 0x10000000
  494.        14891:ci: mapped /usr/lib32/libc.so.1 at 0xfa00000
  495.        RCS/c.c,v  <--  c.c
  496.        file is unchanged; reverting to previous revision 1.1
  497.        done
  498.  
  499.        % nora32                <-- turns off all n32 rld debugging options.
  500.  
  501. ERROR REPORTING
  502.      Most error messages are written to /dev/tty.  If rld encounters an
  503.      error condition for a process without a valid /dev/tty attached, it
  504.      writes the message to /var/adm/SYSLOG.  The system log is written
  505.      using calls to syslog(3C).
  506.  
  507. CHANGING ROOT
  508.      A copy of the device /dev/zero is essential to the operation of rld.
  509.      In most uses of chroot(1M), it is necessary to put a copy of /dev/zero
  510.      in the newly-created root.
  511.  
  512. NOTES
  513.      Listing a particular DSO in _RLD_LIST is likely to lead to problems
  514.      and failures unless all three ABI-specific environment variables are
  515.      set.  A typical result is a message such as the following:
  516.  
  517.           rld: Fatal Error: Cannot Successfully map soname
  518.  
  519.      For example, consider an old 32-bit test application a.out and a
  520.      specific old 32-bit DSO, /tmp/mydso.so:
  521.  
  522.           unsetenv _RLDN32_LIST _RLD64_LIST
  523.           setenv _RLD_LIST "/tmp/mydso.so:DEFAULT"
  524.           ./a.out
  525.  
  526.      This will likely fail because some command, or the application itself,
  527.      will attempt to fork(2) or exec(2) some new 32-bit application, and
  528.      /tmp/mydso.so is an old 32-bit DSO, not a new 32-bit DSO.
  529.      _RLDN32_LIST and _RLD64_LIST do not suffer from this; they are only
  530.      interpreted in a single ABI each. See the description of _RLD_LIST
  531.      earlier in this man page.
  532.  
  533.      Adding the following will fix the problem in this example:
  534.  
  535.           setenv _RLDN32_LIST DEFAULT
  536.           setenv _RLD64_LIST DEFAULT
  537.  
  538. DIAGNOSTICS
  539.      The meaning of the following message from rld is difficult to
  540.      understand:
  541.  
  542.           The aggregate IEEE exceptions required (OEX_FPU_MIN)
  543.           (0xnn) not as complete as the aggregate IEEE
  544.           exceptions permitted (OEX_FPU_MAX>>8)(0xnn).
  545.  
  546.      As the executable and each DSO is accessed before the application
  547.      begins to run, information in the .MIPS.options section is used to
  548.      compute an aggregate set of floating-point exceptions to enable.  The
  549.      .MIPS.options section can be examined with the elfdump(1) command's
  550.      -op option.
  551.  
  552.      For example, specifying the -trapuv compiler option results in a
  553.      request that invalid exception trapping be enabled.  Using certain
  554.      high optimizations in conjunction with the -mips4 and -mips3 compiler
  555.      options, however, requires that those exceptions be turned off so that
  556.      speculative loads of floating-point values can be executed silently.
  557.  
  558.      For more information, see the compiler options
  559.      -TARG:exc_max=[I][U][O][Z][V], -TARG:exc_min=[I][U][O][Z][V], and
  560.      -TENV:X=0..5.
  561.  
  562.      Delay-loaded DSOs and DSOs opened with dlopen(3C) or loaded with
  563.      sgidladd(3C) are not factored in until the actual sgidladd(3C) or
  564.      dlopen(3C) is called.  The OEX_FPU_MIN field of each object is OR'd
  565.      with the others.  The nonzero bits represent the set of floating-point
  566.      exceptions that the application wants to catch (more precisely,
  567.      exceptions that some part of the application or a DSO want to catch).
  568.      The OR'd-together OEX_FPU_MIN fields are used to determine what
  569.      set_fpc_csr() fields to set to 1; rld never sets any set_fpc_csr()
  570.      fields to zero.
  571.  
  572.      The OEX_FPU_MAX field of each object is AND'd with the others.  The
  573.      zero bits represent floating-point exceptions that must not be caught.
  574.      For example, if the code generator is issuing speculative loads, the
  575.      invalid-value exception should not be caught.  If some bits are OFF in
  576.      OEX_FPU_MAX that are ON in OEX_FPU_MIN, that represents an impossible
  577.      scenario:  exceptions must be caught and simultaneously must not be.
  578.      For example, this could happen if an object is compiled requesting
  579.      that uninitialized variables be trapped and a high optimization that
  580.      results in the code generator issuing speculative loads.
  581.  
  582.      As each DSO is opened with dlopen(3C), delay-loaded, loaded using
  583.      sgidladd(3C), or closed with dlclose(3C), these flags are
  584.      recalculated.  If user or library code has changed the five
  585.      exception-flag-enable fields from a previous setting by using rld, rld
  586.      stops updating the exception-enable fields for the execution.
  587.  
  588.      rld never turns off exception-enable flags once it has turned them on.
  589.  
  590.      Use the following to see the OEX fields of an executable or DSOs:
  591.  
  592.           elfdump -op objectname
  593.  
  594. SEE ALSO
  595.      cc(1), chroot(1M), ci(1), csh(1), elfdump(1), file(1), ld(1), ls(1).
  596.  
  597.      exec(2), exit(2), fork(2), sproc(2).
  598.  
  599.      dlclose(3C), dlerror(3C), dlopen(3C), dlsym(3C), sgidladd(3C),
  600.      sgidlopen_version(3C), sgigetdsoversion(3C), syslog(3C).
  601.  
  602.      capabilities(4), capability(4).
  603.  
  604.      dso(5), gp_overflow(5).
  605.  
  606.      System V Application Binary Interface
  607.  
  608.      System V Application Binary Interface: MIPS Processor Supplement
  609.  
  610.      MIPSpro N32 ABI Handbook
  611.  
  612.      This man page is available only online.
  613.